{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "affaf352",
   "metadata": {},
   "source": [
    "# Crypto forecasting\n",
    "\n",
    "\n",
    "## Dataset\n",
    "\n",
    "https://www.kaggle.com/c/g-research-crypto-forecasting"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "d72b7aac",
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "import numpy as np\n",
    "import matplotlib.pyplot as plt\n",
    "import gc\n",
    "%matplotlib inline"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "eff83881",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "asset_details.csv\t       gresearch_crypto\t\t\t  train.csv\r\n",
      "example_sample_submission.csv  g-research-crypto-forecasting.zip\r\n",
      "example_test.csv\t       supplemental_train.csv\r\n"
     ]
    }
   ],
   "source": [
    "!ls ../data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "e8d88bae",
   "metadata": {},
   "outputs": [],
   "source": [
    "asset = pd.read_csv(\"../data/asset_details.csv\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "f97ba201",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Asset_ID</th>\n",
       "      <th>Weight</th>\n",
       "      <th>Asset_Name</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>2</td>\n",
       "      <td>2.397895</td>\n",
       "      <td>Bitcoin Cash</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>0</td>\n",
       "      <td>4.304065</td>\n",
       "      <td>Binance Coin</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1</td>\n",
       "      <td>6.779922</td>\n",
       "      <td>Bitcoin</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>5</td>\n",
       "      <td>1.386294</td>\n",
       "      <td>EOS.IO</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>7</td>\n",
       "      <td>2.079442</td>\n",
       "      <td>Ethereum Classic</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>6</td>\n",
       "      <td>5.894403</td>\n",
       "      <td>Ethereum</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>9</td>\n",
       "      <td>2.397895</td>\n",
       "      <td>Litecoin</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>11</td>\n",
       "      <td>1.609438</td>\n",
       "      <td>Monero</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>13</td>\n",
       "      <td>1.791759</td>\n",
       "      <td>TRON</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>12</td>\n",
       "      <td>2.079442</td>\n",
       "      <td>Stellar</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>3</td>\n",
       "      <td>4.406719</td>\n",
       "      <td>Cardano</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>8</td>\n",
       "      <td>1.098612</td>\n",
       "      <td>IOTA</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>10</td>\n",
       "      <td>1.098612</td>\n",
       "      <td>Maker</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>4</td>\n",
       "      <td>3.555348</td>\n",
       "      <td>Dogecoin</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    Asset_ID    Weight        Asset_Name\n",
       "0          2  2.397895      Bitcoin Cash\n",
       "1          0  4.304065      Binance Coin\n",
       "2          1  6.779922           Bitcoin\n",
       "3          5  1.386294            EOS.IO\n",
       "4          7  2.079442  Ethereum Classic\n",
       "5          6  5.894403          Ethereum\n",
       "6          9  2.397895          Litecoin\n",
       "7         11  1.609438            Monero\n",
       "8         13  1.791759              TRON\n",
       "9         12  2.079442           Stellar\n",
       "10         3  4.406719           Cardano\n",
       "11         8  1.098612              IOTA\n",
       "12        10  1.098612             Maker\n",
       "13         4  3.555348          Dogecoin"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "asset"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "f988f122",
   "metadata": {},
   "outputs": [],
   "source": [
    "df = pd.read_csv(\"../data/train.csv\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "eb168a9e",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>timestamp</th>\n",
       "      <th>Asset_ID</th>\n",
       "      <th>Count</th>\n",
       "      <th>Open</th>\n",
       "      <th>High</th>\n",
       "      <th>Low</th>\n",
       "      <th>Close</th>\n",
       "      <th>Volume</th>\n",
       "      <th>VWAP</th>\n",
       "      <th>Target</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1514764860</td>\n",
       "      <td>2</td>\n",
       "      <td>40.0</td>\n",
       "      <td>2376.5800</td>\n",
       "      <td>2399.5000</td>\n",
       "      <td>2357.1400</td>\n",
       "      <td>2374.5900</td>\n",
       "      <td>19.233005</td>\n",
       "      <td>2373.116392</td>\n",
       "      <td>-0.004218</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1514764860</td>\n",
       "      <td>0</td>\n",
       "      <td>5.0</td>\n",
       "      <td>8.5300</td>\n",
       "      <td>8.5300</td>\n",
       "      <td>8.5300</td>\n",
       "      <td>8.5300</td>\n",
       "      <td>78.380000</td>\n",
       "      <td>8.530000</td>\n",
       "      <td>-0.014399</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1514764860</td>\n",
       "      <td>1</td>\n",
       "      <td>229.0</td>\n",
       "      <td>13835.1940</td>\n",
       "      <td>14013.8000</td>\n",
       "      <td>13666.1100</td>\n",
       "      <td>13850.1760</td>\n",
       "      <td>31.550062</td>\n",
       "      <td>13827.062093</td>\n",
       "      <td>-0.014643</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1514764860</td>\n",
       "      <td>5</td>\n",
       "      <td>32.0</td>\n",
       "      <td>7.6596</td>\n",
       "      <td>7.6596</td>\n",
       "      <td>7.6567</td>\n",
       "      <td>7.6576</td>\n",
       "      <td>6626.713370</td>\n",
       "      <td>7.657713</td>\n",
       "      <td>-0.013922</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>1514764860</td>\n",
       "      <td>7</td>\n",
       "      <td>5.0</td>\n",
       "      <td>25.9200</td>\n",
       "      <td>25.9200</td>\n",
       "      <td>25.8740</td>\n",
       "      <td>25.8770</td>\n",
       "      <td>121.087310</td>\n",
       "      <td>25.891363</td>\n",
       "      <td>-0.008264</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    timestamp  Asset_ID  Count        Open        High         Low  \\\n",
       "0  1514764860         2   40.0   2376.5800   2399.5000   2357.1400   \n",
       "1  1514764860         0    5.0      8.5300      8.5300      8.5300   \n",
       "2  1514764860         1  229.0  13835.1940  14013.8000  13666.1100   \n",
       "3  1514764860         5   32.0      7.6596      7.6596      7.6567   \n",
       "4  1514764860         7    5.0     25.9200     25.9200     25.8740   \n",
       "\n",
       "        Close       Volume          VWAP    Target  \n",
       "0   2374.5900    19.233005   2373.116392 -0.004218  \n",
       "1      8.5300    78.380000      8.530000 -0.014399  \n",
       "2  13850.1760    31.550062  13827.062093 -0.014643  \n",
       "3      7.6576  6626.713370      7.657713 -0.013922  \n",
       "4     25.8770   121.087310     25.891363 -0.008264  "
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.head()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "7522cc14",
   "metadata": {},
   "source": [
    "We can see the different features included in the dataset. Specifically, the features included per asset are the following:\n",
    "\n",
    "- timestamp: All timestamps are returned as second Unix timestamps (the number of seconds elapsed since 1970-01-01 00:00:00.000 UTC). Timestamps in this dataset are multiple of 60, indicating minute-by-minute data.\n",
    "- Asset_ID: The asset ID corresponding to one of the crytocurrencies (e.g. Asset_ID = 1 for Bitcoin). The mapping from Asset_ID to crypto asset is contained in asset_details.csv.\n",
    "- Count: Total number of trades in the time interval (last minute).\n",
    "- Open: Opening price of the time interval (in USD).\n",
    "- High: Highest price reached during time interval (in USD).\n",
    "- Low: Lowest price reached during time interval (in USD).\n",
    "- Close: Closing price of the time interval (in USD).\n",
    "- Volume: Quantity of asset bought or sold, displayed in base currency USD.\n",
    "- VWAP: The average price of the asset over the time interval, weighted by volume. VWAP is an aggregated form of trade data.\n",
    "- Target: Residual log-returns for the asset over a 15 minute horizon."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "7a2f7cc7",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>timestamp</th>\n",
       "      <th>Asset_ID</th>\n",
       "      <th>Count</th>\n",
       "      <th>Open</th>\n",
       "      <th>High</th>\n",
       "      <th>Low</th>\n",
       "      <th>Close</th>\n",
       "      <th>Volume</th>\n",
       "      <th>VWAP</th>\n",
       "      <th>Target</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1514764860</td>\n",
       "      <td>2</td>\n",
       "      <td>40.0</td>\n",
       "      <td>2376.580000</td>\n",
       "      <td>2399.500000</td>\n",
       "      <td>2357.140000</td>\n",
       "      <td>2374.590000</td>\n",
       "      <td>1.923301e+01</td>\n",
       "      <td>2373.116392</td>\n",
       "      <td>-0.004218</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1514764860</td>\n",
       "      <td>0</td>\n",
       "      <td>5.0</td>\n",
       "      <td>8.530000</td>\n",
       "      <td>8.530000</td>\n",
       "      <td>8.530000</td>\n",
       "      <td>8.530000</td>\n",
       "      <td>7.838000e+01</td>\n",
       "      <td>8.530000</td>\n",
       "      <td>-0.014399</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1514764860</td>\n",
       "      <td>1</td>\n",
       "      <td>229.0</td>\n",
       "      <td>13835.194000</td>\n",
       "      <td>14013.800000</td>\n",
       "      <td>13666.110000</td>\n",
       "      <td>13850.176000</td>\n",
       "      <td>3.155006e+01</td>\n",
       "      <td>13827.062093</td>\n",
       "      <td>-0.014643</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1514764860</td>\n",
       "      <td>5</td>\n",
       "      <td>32.0</td>\n",
       "      <td>7.659600</td>\n",
       "      <td>7.659600</td>\n",
       "      <td>7.656700</td>\n",
       "      <td>7.657600</td>\n",
       "      <td>6.626713e+03</td>\n",
       "      <td>7.657713</td>\n",
       "      <td>-0.013922</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>1514764860</td>\n",
       "      <td>7</td>\n",
       "      <td>5.0</td>\n",
       "      <td>25.920000</td>\n",
       "      <td>25.920000</td>\n",
       "      <td>25.874000</td>\n",
       "      <td>25.877000</td>\n",
       "      <td>1.210873e+02</td>\n",
       "      <td>25.891363</td>\n",
       "      <td>-0.008264</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24236801</th>\n",
       "      <td>1632182400</td>\n",
       "      <td>9</td>\n",
       "      <td>775.0</td>\n",
       "      <td>157.181571</td>\n",
       "      <td>157.250000</td>\n",
       "      <td>156.700000</td>\n",
       "      <td>156.943857</td>\n",
       "      <td>4.663725e+03</td>\n",
       "      <td>156.994319</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24236802</th>\n",
       "      <td>1632182400</td>\n",
       "      <td>10</td>\n",
       "      <td>34.0</td>\n",
       "      <td>2437.065067</td>\n",
       "      <td>2438.000000</td>\n",
       "      <td>2430.226900</td>\n",
       "      <td>2432.907467</td>\n",
       "      <td>3.975460e+00</td>\n",
       "      <td>2434.818747</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24236803</th>\n",
       "      <td>1632182400</td>\n",
       "      <td>13</td>\n",
       "      <td>380.0</td>\n",
       "      <td>0.091390</td>\n",
       "      <td>0.091527</td>\n",
       "      <td>0.091260</td>\n",
       "      <td>0.091349</td>\n",
       "      <td>2.193732e+06</td>\n",
       "      <td>0.091388</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24236804</th>\n",
       "      <td>1632182400</td>\n",
       "      <td>12</td>\n",
       "      <td>177.0</td>\n",
       "      <td>0.282168</td>\n",
       "      <td>0.282438</td>\n",
       "      <td>0.281842</td>\n",
       "      <td>0.282051</td>\n",
       "      <td>1.828508e+05</td>\n",
       "      <td>0.282134</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24236805</th>\n",
       "      <td>1632182400</td>\n",
       "      <td>11</td>\n",
       "      <td>48.0</td>\n",
       "      <td>232.695000</td>\n",
       "      <td>232.800000</td>\n",
       "      <td>232.240000</td>\n",
       "      <td>232.275000</td>\n",
       "      <td>1.035123e+02</td>\n",
       "      <td>232.569697</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>24236806 rows × 10 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "           timestamp  Asset_ID  Count          Open          High  \\\n",
       "0         1514764860         2   40.0   2376.580000   2399.500000   \n",
       "1         1514764860         0    5.0      8.530000      8.530000   \n",
       "2         1514764860         1  229.0  13835.194000  14013.800000   \n",
       "3         1514764860         5   32.0      7.659600      7.659600   \n",
       "4         1514764860         7    5.0     25.920000     25.920000   \n",
       "...              ...       ...    ...           ...           ...   \n",
       "24236801  1632182400         9  775.0    157.181571    157.250000   \n",
       "24236802  1632182400        10   34.0   2437.065067   2438.000000   \n",
       "24236803  1632182400        13  380.0      0.091390      0.091527   \n",
       "24236804  1632182400        12  177.0      0.282168      0.282438   \n",
       "24236805  1632182400        11   48.0    232.695000    232.800000   \n",
       "\n",
       "                   Low         Close        Volume          VWAP    Target  \n",
       "0          2357.140000   2374.590000  1.923301e+01   2373.116392 -0.004218  \n",
       "1             8.530000      8.530000  7.838000e+01      8.530000 -0.014399  \n",
       "2         13666.110000  13850.176000  3.155006e+01  13827.062093 -0.014643  \n",
       "3             7.656700      7.657600  6.626713e+03      7.657713 -0.013922  \n",
       "4            25.874000     25.877000  1.210873e+02     25.891363 -0.008264  \n",
       "...                ...           ...           ...           ...       ...  \n",
       "24236801    156.700000    156.943857  4.663725e+03    156.994319       NaN  \n",
       "24236802   2430.226900   2432.907467  3.975460e+00   2434.818747       NaN  \n",
       "24236803      0.091260      0.091349  2.193732e+06      0.091388       NaN  \n",
       "24236804      0.281842      0.282051  1.828508e+05      0.282134       NaN  \n",
       "24236805    232.240000    232.275000  1.035123e+02    232.569697       NaN  \n",
       "\n",
       "[24236806 rows x 10 columns]"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "e796dbb3",
   "metadata": {},
   "outputs": [],
   "source": [
    "btc = df[df.Asset_ID == 1].reset_index(drop=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "c218b65e",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "66"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "del df\n",
    "gc.collect()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "c720cf7b",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>timestamp</th>\n",
       "      <th>Asset_ID</th>\n",
       "      <th>Count</th>\n",
       "      <th>Open</th>\n",
       "      <th>High</th>\n",
       "      <th>Low</th>\n",
       "      <th>Close</th>\n",
       "      <th>Volume</th>\n",
       "      <th>VWAP</th>\n",
       "      <th>Target</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1514764860</td>\n",
       "      <td>1</td>\n",
       "      <td>229.0</td>\n",
       "      <td>13835.194</td>\n",
       "      <td>14013.8</td>\n",
       "      <td>13666.11</td>\n",
       "      <td>13850.176</td>\n",
       "      <td>31.550062</td>\n",
       "      <td>13827.062093</td>\n",
       "      <td>-0.014643</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1514764920</td>\n",
       "      <td>1</td>\n",
       "      <td>235.0</td>\n",
       "      <td>13835.036</td>\n",
       "      <td>14052.3</td>\n",
       "      <td>13680.00</td>\n",
       "      <td>13828.102</td>\n",
       "      <td>31.046432</td>\n",
       "      <td>13840.362591</td>\n",
       "      <td>-0.015037</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1514764980</td>\n",
       "      <td>1</td>\n",
       "      <td>528.0</td>\n",
       "      <td>13823.900</td>\n",
       "      <td>14000.4</td>\n",
       "      <td>13601.00</td>\n",
       "      <td>13801.314</td>\n",
       "      <td>55.061820</td>\n",
       "      <td>13806.068014</td>\n",
       "      <td>-0.010309</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1514765040</td>\n",
       "      <td>1</td>\n",
       "      <td>435.0</td>\n",
       "      <td>13802.512</td>\n",
       "      <td>13999.0</td>\n",
       "      <td>13576.28</td>\n",
       "      <td>13768.040</td>\n",
       "      <td>38.780529</td>\n",
       "      <td>13783.598101</td>\n",
       "      <td>-0.008999</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>1514765100</td>\n",
       "      <td>1</td>\n",
       "      <td>742.0</td>\n",
       "      <td>13766.000</td>\n",
       "      <td>13955.9</td>\n",
       "      <td>13554.44</td>\n",
       "      <td>13724.914</td>\n",
       "      <td>108.501637</td>\n",
       "      <td>13735.586842</td>\n",
       "      <td>-0.008079</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    timestamp  Asset_ID  Count       Open     High       Low      Close  \\\n",
       "0  1514764860         1  229.0  13835.194  14013.8  13666.11  13850.176   \n",
       "1  1514764920         1  235.0  13835.036  14052.3  13680.00  13828.102   \n",
       "2  1514764980         1  528.0  13823.900  14000.4  13601.00  13801.314   \n",
       "3  1514765040         1  435.0  13802.512  13999.0  13576.28  13768.040   \n",
       "4  1514765100         1  742.0  13766.000  13955.9  13554.44  13724.914   \n",
       "\n",
       "       Volume          VWAP    Target  \n",
       "0   31.550062  13827.062093 -0.014643  \n",
       "1   31.046432  13840.362591 -0.015037  \n",
       "2   55.061820  13806.068014 -0.010309  \n",
       "3   38.780529  13783.598101 -0.008999  \n",
       "4  108.501637  13735.586842 -0.008079  "
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "btc.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "401a499f",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0   1970-01-01 00:00:01.514764860\n",
       "1   1970-01-01 00:00:01.514764920\n",
       "2   1970-01-01 00:00:01.514764980\n",
       "3   1970-01-01 00:00:01.514765040\n",
       "4   1970-01-01 00:00:01.514765100\n",
       "Name: timestamp, dtype: datetime64[ns]"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pd.to_datetime(btc.timestamp.head())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "871e3d55",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.10"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
